﻿@model ArbabTravelsERP.Models.VisaModel

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<!-- daterangepicker -->
<script type="text/javascript" src="js/moment.min2.js"></script>
<script type="text/javascript" src="js/datepicker/daterangepicker.js"></script>


<script type="text/javascript">
    $(document).ready(function () {
        $("#SaveImage").change(function (e) {
            debugger;
            var imagepath = $("#SaveImage").val();
            $("#FILE_PATH").val(imagepath);
        });
    });
</script>

@*<script type="text/javascript">
        $(document).ready(function () {
            $('#ISSUE_DATE, #EXPIRY_DATE, #RECIEVED_DATE').daterangepicker({
                singleDatePicker: true,
                calender_style: "picker_4"
            }, function (start, end, label) {
                console.log(start.toISOString(), end.toISOString(), label);
            });
        });
    </script>*@

@using (Html.BeginForm("CreateVisa", "Visa", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @id = "formControl", @class = "form-horizontal", enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()

                <!-- page content -->
    <div class="right_col" role="main">
        <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3>Visa</h3>
                </div>
            </div>
            <div class="clearfix"></div>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel form-horizontal">
                        <div class="x_title">
                            <h2>Add Visa Details</h2>
                            <div class="clearfix"></div>
                        </div>

                        <div class="x_content">
                            @if (@TempData["Success"] != null)
                                        {
                                        <div class="alert alert-success alert-dismissable">
                                            <button type="button" class="close" data-dismiss="alert"
                                                    aria-hidden="true">
                                                &times;
                                            </button>
                                            @TempData["Success"]
                                        </div>
                                        }

                            <br />
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Client Name <span class="required">*</span> </label>
                                <div class="col-md-6 col-sm-6">
                                    @Html.DropDownListFor(model => model.REGISTRATION_NO, ViewData["GetSource"] as SelectList, "Select Client", new { @id = "REGISTRATION_NO", @class = "form-control", @autocomplete = "off" })
                                    @Html.ValidationMessageFor(model => model.REGISTRATION_NO, "", new { @class = "text-danger" })
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Civilian Number</label>
                                <div class="col-md-6 col-sm-6">
                                    @Html.TextBoxFor(model => model.CIVILIAN_NUMBER, new { @id = "CIVILIAN_NUMBER", @class = "form-control", @placeholder = "Civilian Number", @autocomplete = "off", @maxlength = "20", @readonly = "readonly" })
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Visa Number<span class="required">*</span></label>
                                <div class="col-md-6 col-sm-6">
                                    @Html.TextBoxFor(model => model.VISA_NUMBER, new { @id = "VISA_NUMBER", @class = "form-control", @placeholder = "Visa Number", @autocomplete = "off", @maxlength = "20" })
                                    @Html.ValidationMessageFor(model => model.VISA_NUMBER, "", new { @class = "text-danger" })
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Purpose <span class="required">*</span></label>
                                <div class="col-md-6 col-sm-6">
                                    @{
                                        List<SelectListItem> listPurpose = new List<SelectListItem>();
                                        listPurpose.Add(new SelectListItem
                                        {
                                            Text = "Employment",
                                            Value = "Employment"
                                        });
                                        listPurpose.Add(new SelectListItem
                                        {
                                            Text = "Service",
                                            Value = "Service"
                                        });
                                    }
                                    @Html.DropDownListFor(model => model.PURPOSE, listPurpose, "--Select Purpose--", new { @id = "PURPOSE", @class = "form-control", @autocomplete = "off" })
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Place of Endorsement<span class="required">*</span> </label>
                                <div class="col-md-6 col-sm-6">
                                    @{
                                        List<SelectListItem> listPlaceEndorse = new List<SelectListItem>();
                                        listPlaceEndorse.Add(new SelectListItem
                                        {
                                            Text = "Mumbai",
                                            Value = "Mumbai"
                                        });
                                        listPlaceEndorse.Add(new SelectListItem
                                        {
                                            Text = "Delhi",
                                            Value = "Delhi"
                                        });
                                    }
                                    @Html.DropDownListFor(model => model.PLACE_OF_ENDORSEMENT, listPlaceEndorse, "--Select Place of Endorsement--", new { @id = "PLACE_OF_ENDORSEMENT", @class = "form-control", @autocomplete = "off" })
                                </div>
                            </div>

                            <div class="input-daterange">
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3">Issue Date<span class="required">*</span></label>
                                    <div class="col-md-6 col-sm-6">
                                        @Html.TextBoxFor(model => model.ISSUE_DATE, new { @id = "ISSUE_DATE", @class = "form-control  date-picker", @placeholder = "Issue Date", @autocomplete = "off", @maxlength = "20" })
                                        @Html.ValidationMessageFor(model => model.ISSUE_DATE, "", new { @class = "text-danger" })
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3">Expiry Date<span class="required">*</span></label>
                                    <div class="col-md-6 col-sm-6">
                                        @Html.TextBoxFor(model => model.EXPIRY_DATE, new { @id = "EXPIRY_DATE", @class = "form-control  date-picker", @placeholder = "Expiry Date", @autocomplete = "off", @maxlength = "20" })
                                        @Html.ValidationMessageFor(model => model.EXPIRY_DATE, "", new { @class = "text-danger" })
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Received On<span class="required">*</span></label>
                                <div class="col-md-6 col-sm-6">
                                    @Html.TextBoxFor(model => model.RECIEVED_DATE, new { @id = "RECIEVED_DATE", @class = "form-control  date-picker", @placeholder = "Received Date", @autocomplete = "off", @maxlength = "20" })
                                    @Html.ValidationMessageFor(model => model.RECIEVED_DATE, "", new { @class = "text-danger" })
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Upload File<span class="required">*</span></label>
                                <div class="fileinput fileinput-new col-md-6 col-sm-6" data-provides="fileinput">
                                    <div>
                                        <span class="btn btn-default btn-file"><span class="fileinput-new">Select image</span><span class="fileinput-exists">Change</span><input type="file" name="..." id="SaveImage"></span>
                                        <a href="#" class="btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
                                        @Html.HiddenFor(model => model.FILE_PATH)
                                        @Html.ValidationMessageFor(model => model.FILE_PATH, "", new { @class = "text-danger" })
                                    </div>

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3">Remark</label>
                                <div class="col-md-6 col-sm-6">
                                    @Html.TextAreaFor(model => model.REMARK, new { @id = "REMARK", @class = "form-control", @placeholder = "Remark", @autocomplete = "off" })
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-offset-4 col-md-1">
                                    <input type="submit" value="Create" class="btn btn-default" />
                                </div>
                                <div class="col-md-offset-0 col-md-1">
                                    <input type="submit" value="Reset" class="btn btn-block" />
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
}

